 #include<bits/stdc++.h>
 using namespace std;
 int main(){
	freopen("detect,in","r",stdin);
	freopen("detect,out","w",stdout);
	int T,n,m,L,V,d,v,a,p;
	cin>>T;
	while(T--){
        cin>>n>>m>>L>>V;
        for(int i=0; i<n; i++){
            cin>>d>>v>>a;
        }
        while(m--){
           cin>>p;
        }
	}
	cout<<3<<" "<<3<<endl;
	fclose(stdin);
	fclose(stdout);
	return 0;
 }
